package cn.wolfcode.web.controller;

import cn.wolfcode.common.web.CodeMsg;
import cn.wolfcode.common.web.Result;
import cn.wolfcode.config.AlipayProperties;
import cn.wolfcode.domain.PayVo;
import cn.wolfcode.service.IAlipay;
import cn.wolfcode.web.msg.PayCodeMsg;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.request.AlipayTradePagePayRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping("/alipay")
public class AlipayController {

    @Autowired
    private IAlipay alipay;

    @PostMapping("/prepay")
    public Result<Object> prepay(@RequestBody PayVo vo) {

        // 支付宝预支付业务逻辑
       return Result.success(alipay.prepay(vo));
    }
}
